﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using Inaction.Core;
using Inaction.Mapping;

namespace Inaction.Business.Security.Abstract
{
    [Table("AssemblyClassRole"), DisplayName("程序集类角色"), Serializable]
    public abstract class AssemblyClassRole<T> : Inaction.Business.Entity<T> where T : AssemblyClassRole<T>, new()
    {
        #region 属性

        public static readonly Property<Guid?> IdProperty = RegisteProperty<Guid?>(p => p.Id);
        Guid? _id;
        [Column("Id"), DisplayName("程序集类角色"), Display(Description = "程序集类角色")]
        public Guid? Id
        {
            get { return _id; }
            internal set { SetProperty(IdProperty, ref _id, value); }
        }

        public static readonly Property<Guid?> AssemblyClassIdProperty = RegisteProperty<Guid?>(p => p.AssemblyClassId);
        Guid? _assemblyClassId;
        [Column("AssemblyClassId"), DisplayName("程序集类"), Display(Description = "程序集类")]
        public Guid? AssemblyClassId
        {
            get { return _assemblyClassId; }
            set { SetProperty(AssemblyClassIdProperty, ref _assemblyClassId, value); }
        }

        public static readonly Property<Guid?> RoleIdProperty = RegisteProperty<Guid?>(p => p.RoleId);
        Guid? _roleId;
        [Column("RoleId"), DisplayName("角色"), Display(Description = "角色")]
        public Guid? RoleId
        {
            get { return _roleId; }
            set { SetProperty(RoleIdProperty, ref _roleId, value); }
        }

        public static readonly Property<Boolean?> AllowQueryProperty = RegisteProperty<Boolean?>(p => p.AllowQuery, true);
        Boolean? _allowQuery;
        [Column("AllowQuery"), DisplayName("是否可查询"), Display(Description = "是否可查询")]
        public Boolean? AllowQuery
        {
            get { return _allowQuery; }
            set { SetProperty(AllowQueryProperty, ref _allowQuery, value); }
        }

        public static readonly Property<Boolean?> AllowNewProperty = RegisteProperty<Boolean?>(p => p.AllowNew, true);
        Boolean? _allowNew;
        [Column("AllowNew"), DisplayName("是否可新增"), Display(Description = "是否可新增")]
        public Boolean? AllowNew
        {
            get { return _allowNew; }
            set { SetProperty(AllowNewProperty, ref _allowNew, value); }
        }

        public static readonly Property<Boolean?> AllowEditProperty = RegisteProperty<Boolean?>(p => p.AllowEdit, true);
        Boolean? _allowEdit;
        [Column("AllowEdit"), DisplayName("是否可编辑"), Display(Description = "是否可编辑")]
        public Boolean? AllowEdit
        {
            get { return _allowEdit; }
            set { SetProperty(AllowEditProperty, ref _allowEdit, value); }
        }

        public static readonly Property<Boolean?> AllowRemoveProperty = RegisteProperty<Boolean?>(p => p.AllowRemove, true);
        Boolean? _allowRemove;
        [Column("AllowRemove"), DisplayName("是否可删除"), Display(Description = "是否可删除")]
        public Boolean? AllowRemove
        {
            get { return _allowRemove; }
            set { SetProperty(AllowRemoveProperty, ref _allowRemove, value); }
        }


        #endregion
    }
}
